package com.erp.app.common.query;

import com.erp.app.setup.country.pk.CountryHdrPk;

public class CountryCodeQuery extends BeanQuery {

    public CountryCodeQuery() {
        super("SELECT COUNTRY_CODE, COUNTRY_NAME FROM T_COUNTRY_HDR WHERE " +
                "COMPANY_CODE = `companyCode:string` AND " +
                "(STATUS = `$GENERIC_ACTIVE:string` OR COUNTRY_CODE = `countryCode:string`) " +
                "ORDER BY COUNTRY_NAME");
    }

    public CountryCodeQuery setCountryHdrPk(CountryHdrPk pk) {
        this.setModel(pk);
        return this;
    }

    public CountryCodeQuery setCompanyCode(String companyCode) {
        return this.setCountryHdrPk(new CountryHdrPk(companyCode, null));
    }

}
